#include <iostream>
using namespace std;

float fun(float x) { return (x-4)*(x-3)*(x-3)*(x-3); }

int searchmin() {
	float xmin=0,a=0,b=3,l=0,x1=0,x2=0; int i=0;
    const float delta=0.01, e=0.001;
       l=b-a;
       cout << "   N   " << "     a  "<< "      b  \n";
    while (l>delta){
    	i++;
	    x1=(a+b)/2-e;
	    x2=(a+b)/2+e;
	    if (fun(x1)>=fun(x2)){ a=x1; }
	    else { b=x2; }
	    l=b-a;
	    cout << "   "<<i<<"     "<<a<<"     "<<b<<"\n";
    };
    xmin=(a+b)/2;
    cout<< "xmin= "<<xmin;
return 0;
}

int main() {
	searchmin();
	return 0;
}
